package lq.demo.springbootmybatis.demo.entity;

import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.HashMap;

/**
 * @program: comment-demo
 * @description:
 * @author: LQ
 * @create: 2020-09-23 12:45
 */
@Data
@Component
public class MyRespon extends HashMap {
    private static final String CODE = "200";
    private static final String OK = "1";
    private static final String FAIL = "-1";

    public MyRespon ok(){
        this.put("code",MyRespon.CODE);
        this.put("status",MyRespon.OK);
        return this;
    }

    public MyRespon setResult(Object result){
        this.put("result",result);
        return this;
    }

    public MyRespon setMessage(Object message){
        this.put("message",message);
        return this;
    }

}
